/**
 * Author: Dmitry Ustimov
 * Date: 5/14/13
 * Time: 10:07 PM
 */

package com.gmail.dmitryustimov.ms.java7.mediator.classic.example.classic_example3;

public class Demo {

    public static void main(String[] args) {

        FacebookGroupMediator m = new FacebookGroupMediator();

        Fan fan1 = new Fan(m, "Fan 1");
        FanB fan2 = new FanB(m, "Fan 2");
        Fan fan3 = new Fan(m, "Fan 3");

        fan1.send("i like this group");
        // this is the fan who does not want to get copy own messages
        fan2.send("yes i also like this group");
        // fan 3 temp uncheck to get the messages
        m.block(fan3.receiver);
        fan1.send("Do you agree that this is the best group");
        fan2.send("Yes i Agree");
        m.unblock(fan3.receiver);
        // open again
        fan1.send("Thanks all");
    }
}
